import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建学校管理--系部
export function createDepartments(data) {
  return request({
    url: adminUrl + '/collegebase/departments/create',
    method: 'post',
    data: data
  })
}

// 更新学校管理--系部
export function updateDepartments(data) {
  return request({
    url: adminUrl + '/collegebase/departments/update',
    method: 'put',
    data: data
  })
}

// 删除学校管理--系部
export function deleteDepartments(id) {
  return request({
    url: adminUrl + '/collegebase/departments/delete?id=' + id,
    method: 'delete'
  })
}

// 获得学校管理--系部
export function getDepartments(id) {
  return request({
    url: adminUrl + '/collegebase/departments/get?id=' + id,
    method: 'get'
  })
}

// 获得学校管理--系部分页
export function getDepartmentsPage(query) {
  return request({
    url: adminUrl + '/collegebase/departments/page',
    method: 'get',
    params: query
  })
}

// 导出学校管理--系部 Excel
export function exportDepartmentsExcel(query) {
  return request({
    url: adminUrl + '/collegebase/departments/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
